"""
@author: chy
@file: n阶楼梯走法.py
@time: 2023/12/9 16:27
"""
def countWays(n):
    if n <= 2:
        return n
    ways = [0] * (n + 1)
    ways[1] = 1
    ways[2] = 2
    for i in range(3, n + 1):
        ways[i] = ways[i - 1] + ways[i - 2]
    return ways[n]


print(countWays(10))